<template>
  <div class="home">
   <h2>模块--{{name}}</h2>
   <button @click="CHANGE_NAME">改变</button>
   <button @click="init">发起异步</button>
  </div>
  
</template>

<script>
import { mapState,mapGetters,mapMutations,mapActions } from 'vuex'

export default {
  name: 'HomeView',
  computed:{
    //mapstate映射模块里数据 mapState("模块名称")
    ...mapState("xu",["name" ]),
    ...mapGetters("xu",["newName" ])
  },
  methods:{
    ...mapMutations("xu",["CHANGE_NAME"]),
    ...mapActions("xu",["init"])
  }
}
</script>
